import { resources, _decorator, Component, Node, Prefab, instantiate } from "cc";
const { ccclass, property } = _decorator;

@ccclass("planes")
export class planes extends Component {
  planeList: Node[] = [];
  start() {
    this.createPlanes(10);
  }

  createPlanes(count: number) {
    resources.load("prefab/plane", Prefab, (err, data) => {
      if (err) return;
      for (let i = 0; i < count; i++) {
        const plane = instantiate(data);
        plane.setParent(this.node);
      }
    });
  }
  update(deltaTime: number) {}
}
